#唐门优测
#道长最帅666

from common.read_yaml import get_yaml_filepath
from common.readCofig import Envison
import pytest
from common.logintoken import login_zs,login_ls
from api.admin.member_controller_api import MemberControllerApi
data = get_yaml_filepath(Envison=Envison)



"""------------------------------进行初始化登录----------------------------"""
@pytest.fixture(scope="session",autouse=True)
def azs_login(zhangsan_info):
    login_zs(zhangsan_info,'zhangsan_token')

@pytest.fixture(scope="session",autouse=True)
def als_login(zhangsan_info):
    login_ls(zhangsan_info,'lisi_token')

"""------------------------------获取账号数据----------------------------"""
@pytest.fixture(scope="session")
def zhangsan_info():
    return data['zhangsan']

@pytest.fixture(scope="session")
def lisi_info():
    return data['lisi']


"""------------------------------调用api并且进行token身份切换----------------------------"""
"张三模块"
@pytest.fixture(scope="session")
def member_controller_z():
    return MemberControllerApi("zhangsan_token")

"李四模块"
@pytest.fixture(scope="session")
def member_controller_l():
    return MemberControllerApi("lisi_token")